/**
 * 
 */
package com.scpii.universal.hibernate.dao.impl;

import org.springframework.stereotype.Repository;

import com.scpii.universal.hibernate.dao.AppIconDao;
import com.scpii.universal.hibernate.entity.AppIconTab;

/**
 * genericWeb
 * @author weny
 * 2012-7-6上午10:16:50
 */
@Repository
public class AppIconDaoImpl extends BaseDaoImpl<AppIconTab, Integer>  implements AppIconDao {

	public String getIconUrlById(int iconId){
		String hql = "select new AppIconTab(a.varIconUrl) from AppIconTab a" +
			" where a.intIconId=?";
		AppIconTab icon = (AppIconTab) getHibernateTemplate()
				.getSessionFactory().getCurrentSession().createQuery(hql)
				.setParameter(0, iconId).uniqueResult();
		if (icon != null && icon.getVarIconUrl() != null) {
			return icon.getVarIconUrl();
		}
		return "";
	}
}
